/*
 * Copyright (c)  2015~2020, xforceplus
 * All rights reserved.
 * Project:datacare-orm
 * Id: OrderBy.java   2020-10-07 20-15-00
 * Author: Evan
 */
package cn.datacare.orm.query.order;


import static cn.datacare.orm.util.Separator.COMMA;
import static cn.datacare.orm.util.StringUtils.*;

/**
 * <p>
 * Title:
 * </p>
 * <p>
 * Description:
 * </p>
 * <p>
 * Copyright: 2015~2020
 * </p>
 * <p>
 * Company/Department: xforceplus
 * </p>
 *
 * @author Evan
 * <b>Creation Time:</b> 2020-10-07 20-15-00
 * @since V1.0
 */
public class OrderBy {

    private static final String ORDER_BY="ORDER BY ";

    private StringBuilder sb=new StringBuilder(ORDER_BY);

    public void add(String str){
        sb.append(str).append(SPACE+ COMMA);
    }

    public String getOrderBy(){
        sb.setLength(sb.length()-1);
        return sb.toString();
    }
}
